import javax.swing.JFrame;
import javax.swing.JMenuBar;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenu;
import javax.swing.JMenuItem;

import kr.or.kead.ui.input.EmpManagerment;
import kr.or.kead.ui.input.ProductManagerment;



public class MainView extends JFrame implements ActionListener{
	private JMenuItem emp_mng_menu, prod_mng_menu, client_mng_menu, sell_smenu, emp_state,
	prod_state, client_state, client_trade, prod_trade, emp_trade;
	
		
	public MainView() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setSize(new Dimension(400, 300));
		setTitle("매장관리프로그램");
		JMenuBar menuBar = new JMenuBar();
		getContentPane().add(menuBar, BorderLayout.NORTH);

		JMenu basic_menu = new JMenu("기초자료관리");
		menuBar.add(basic_menu);	

		emp_mng_menu = new JMenuItem("영업사원관리");
		emp_mng_menu.addActionListener(this);
		basic_menu.add(emp_mng_menu);

		prod_mng_menu = new JMenuItem("제품관리");
		prod_mng_menu.addActionListener(this);
		basic_menu.add(prod_mng_menu);

		client_mng_menu = new JMenuItem("거래처관리");
		client_mng_menu.addActionListener(this);
		basic_menu.add(client_mng_menu);

		JMenu sell_menu = new JMenu("판매관리");
		menuBar.add(sell_menu);

		sell_smenu = new JMenuItem("판매관리");
		sell_smenu.addActionListener(this);
		sell_menu.add(sell_smenu);

		JMenu search_menu = new JMenu("조회업무");
		menuBar.add(search_menu);

		emp_state = new JMenuItem("영업사원현황");
		emp_state.addActionListener(this);
		search_menu.add(emp_state);

		prod_state = new JMenuItem("제품현황");
		prod_state.addActionListener(this);
		search_menu.add(prod_state);

		client_state = new JMenuItem("거래처현황");
		client_state.addActionListener(this);
		search_menu.add(client_state);

		client_trade = new JMenuItem("거래처별 거래 현황");
		client_trade.addActionListener(this);
		search_menu.add(client_trade);

		prod_trade = new JMenuItem("제품별 거래 현황");
		prod_trade.addActionListener(this);
		search_menu.add(prod_trade);

		emp_trade = new JMenuItem("영업사원별 거래 현황");
		emp_trade.addActionListener(this);
		search_menu.add(emp_trade);		
		
	}


	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == emp_mng_menu) {
			EmpManagerment empM = new EmpManagerment(this);			
		}else if(e.getSource() == prod_mng_menu) {
			ProductManagerment prodM = new ProductManagerment(this);
		}else if(e.getSource() == client_mng_menu) {

		}else if(e.getSource() == sell_smenu) {

		}else if(e.getSource() == emp_state) {

		}else if(e.getSource() == prod_state) {

		}else if(e.getSource() == client_state) {

		}else if(e.getSource() == client_trade) {

		}else if(e.getSource() == prod_trade) {

		}else if(e.getSource() == emp_trade) {

		}
		this.validate();
	}

	@SuppressWarnings("deprecation")
	public static void main(String[] args) {
		MainView mv = new MainView();
		mv.setVisible(true);
	}
}
